#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
#define ll long long
map<int, int> mp;

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int n; cin >> n;
    for (int i = 1; i <= n; i++) {
        int x; cin >> x;
        mp[x]++;
    }
    ll ans = 0;
    for (auto v : mp) {
        if (v.first == v.second) continue;
        else if (v.first < v.second) ans += v.second - v.first;
        else ans += v.second;
    }
    cout << ans << '\n';
    return 0;
}